home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / t3_1 / risc_src.lha / risc_sources / comp / build / pmaxbuild.t < prev    next >
Encoding:
Text File  |  1990-10-16  |  4.3 KB  |  126 lines

  1. (herald sunbuild)
  2. #|
  3.  
  4. To build a new system from sources:
  5.  
  6. 1. You should be in a directory with sources and tsystem as subdirectories
  7.    Execute the shell script in tsystem/envset
  8. 2. Start up tsystem/xt and load this file into orbit-env
  9. 3. (compile-support) and (exit)
  10. 4. Start up tsystem/xt again and load this file into orbit-env
  11. 5. (compile-sources) and (link-t '(tsystem new)) and (exit)
  12. 6. cd tsystem; linkt new.o new; cd ..
  13. 7. tsystem/new is a T without compiler. Start up new with a large heap.
  14. 8. ((*value t-implementation-env 'load-and-suspend-system) '(tsystem new) t)
  15.    (exit)
  16. 9. cd tsystem; linkt new.o new    That's it.
  17.  
  18. |#
  19.  
  20. ;;; Build compiler early binding environment
  21.  
  22. (lset *endian* 'little)
  23.  
  24. (*define user-env 'compile-support
  25. (lambda ()
  26. (create-support '(t3_primops mipsconstants) '(t3_primops mipsconstants))
  27. (load '(t3_primops mipsconstants t) orbit-env)
  28. (orbit-mips-setup 't3_primops)
  29. (orbit-init 'base)
  30. (set (orbit-syntax-table) primop-syntax-table)
  31. (set *compile-primops?* nil)
  32. (create-support '(t3_primops mipsprimops)   '(t3_primops mipsprimops))
  33. (create-support '(t3_primops mipsarith)     '(t3_primops mipsarith))
  34. (create-support '(t3_primops locations)    '(t3_primops locations))
  35. (create-support '(t3_primops mipslow)       '(t3_primops mipslow))
  36. (create-support '(t3_primops predicates)       '(t3_primops predicates))
  37. (orbit-init 'base  
  38.             'constants 'primops 'arith 'locations 'low 'predicates)
  39. (create-support '(t3_primops open)    '(t3_primops open))
  40. (create-support '(t3_primops aliases) '(t3_primops aliases))
  41. (create-support '(t3_primops carcdr)  '(t3_primops carcdr))
  42. (create-support '(t3_primops mipsgenarith)  '(t3_primops mipsgenarith))))
  43.  
  44. ;;; compile compiler code in early binding environment, runtime system
  45.  
  46. (*define user-env 'compile-sources
  47. (lambda ()
  48. (set (orbit-syntax-table) primop-syntax-table)
  49. (comfile '(t3_primops base))
  50. (compile-primop-source '(t3_primops mipsprimops   mli))
  51. (compile-primop-source '(t3_primops mipsarith     mli))
  52. (compile-primop-source '(t3_primops locations    mli))
  53. (compile-primop-source '(t3_primops mipslow       mli))
  54. (compile-primop-source '(t3_primops mipsgenarith    mli))
  55. (set *compile-primops?* nil)
  56. (set (table-entry *modules* 'bignum) '(osys risc_bignum))
  57. (load-quietly '(t3_primops mipsconstants t) orbit-env)
  58. (set (orbit-syntax-table) (env-syntax-table t-implementation-env))
  59. (orbit-mips-init 't3_primops)
  60. ;(set primop/computed-goto (table-entry primop-table 'computed-goto))
  61. (define (comsys system . start)
  62.   (walk (lambda (file)
  63.       (xcase (car file)
  64.             ((osys)
  65.          (set (tc-syntax-table) (env-syntax-table t-implementation-env))
  66.          (comfile file))
  67.         ((t3_primops)
  68.          (set (tc-syntax-table) primop-syntax-table)
  69.          (bind ((write-support-file false))
  70.            (comfile file)))))
  71.     (let ((files (xcase system
  72.                ((z) *zvm-system*)
  73.                ((t) *t-system*))))
  74.       (if start (mem alikev? (car start) files) files))))
  75. (load '(osys pmax_files) orbit-env)
  76. (comsys 't)
  77. (comfile '(link defs))
  78. (comfile '(link linker))
  79. (comfile '(link pmax_link))
  80. (comfile '(link lp_table))
  81. (comfile '(link suspend))
  82. (comfile '(link pmaxsuspend))
  83. (comfile '(tscheme scheme))
  84. (comfile '(tscheme syntax))
  85. (comfile '(tscheme system))
  86. (comfile '(tscheme runtime))
  87. (comfile '(tscheme compiler))
  88. (set (tc-syntax-table) (env-syntax-table orbit-env))
  89. (comfile '(front_end pmaxfix))
  90. (walk comfile
  91.       (append *orbit-files*
  92.           *top-files*
  93.           *front-files*
  94. ;          '((front_end computed_goto))
  95.           *back-end-files*
  96.           *orbit-mips-files*
  97.           *tas-mips-files*))))
  98.  
  99.  
  100. (define (load-linker . system)
  101.   (let* ((system (if (null? system) 
  102.                      ((*value t-implementation-env 'machine-type) 
  103.                       ((*value t-implementation-env 'local-machine)))
  104.                      (car system)))
  105.          (link-env (make-locale orbit-env 'link-env)))
  106.     (*define standard-env 'link-env link-env)
  107.     (load '(link defs )         link-env)
  108.     (load '(link linker )       link-env)
  109.     (load 
  110.      '(link pmax_link)
  111.      link-env)
  112.     (load '(t3_primops mipsconstants t)  link-env)
  113.     (*define standard-env  'link
  114.          (lambda (files outfile)
  115.            (set (repl-results) nil)
  116.            (gc)
  117.            ((*value link-env 'link) files outfile)))))
  118.  
  119. (*define user-env 'link-t
  120. (lambda (file)
  121. (load-linker)
  122. (load '(osys pmax_files) orbit-env)
  123. (link *t-system* file)))
  124.  
  125.  
  126.